$(document).ready(function(){
	$('a.accordion-toggle').on('click', function(){
		var hasclass = $(this).hasClass('collapsed');
		if(hasclass){
			$(this).find('i').removeClass('fa fa-chevron-right').addClass('fa fa-chevron-down');
		} else {
			$(this).find('i').removeClass('fa fa-chevron-down').addClass('fa fa-chevron-right');
		}
	});	
	
	var url = window.location.href;
	$('ul#main_nav').find('a').each(function() {
		if($(this).attr('href').indexOf(url) !== -1) {
			$(this).parent().addClass('active');
		}
	})

});

function inday(){
  $('.table-responsive').load('admin/getInfo/day');
}

function inweek(){
  $('.table-responsive').load('admin/getInfo/week');
}

function inmonth(){
  $('.table-responsive').load('admin/getInfo/month');
}

function inyear(){
  $('.table-responsive').load('admin/getInfo/year');
}

function getall(){
  $('.table-responsive').load('admin/getInfo/all');
}

function searchreport(){
  $('.table-responsive').load('admin/getInfo/' + $('.datepicker').val());
}
